import axios from '@/libs/request/axios'
export const getUserInfo = () => {
    return axios.request({
        url: '/admin/user/info',
        method: 'get'
    })
}

export const unlock = (params) => {
    return axios.request({
        url: '/admin/user/unlock',
        data:params,
        method: 'post'
    })
}
export const changePass = (params) => {
    return axios.request({
        url: '/admin/user/modifyPass',
        data:params,
        method: 'post'
    })
}


// 获取用户数据 多条件
export const getUserListData = (params) => {
    return axios.request({
        url: '/admin/user/getByCondition',
        params:params,
        method: 'get'
    })
}
// 获取全部用户数据
export const getAllUserData = (params) => {
    return axios.request({
        url: '/admin/user/getAll',
        params:params,
        method: 'get'
    })
}
// 添加用户
export const addUser = (params) => {
    return axios.request({
        url: '/admin/user/addmember',
        data:params,
        method: 'post'
    })
}
// 编辑用户
export const editUser = (params) => {
    return axios.request({
        url: '/admin/user/editmember',
        data:params,
        method: 'post'
    })
}
// 启用用户
export const enableUser = (id, params) => {
    return axios.request({
        url: `/admin/user/enable/${id}`,
        data:params,
        method: 'post'
    })
}
// 禁用用户
export const disableUser = (id, params) => {
    return axios.request({
        url: `/admin/user/disable/${id}`,
        data:params,
        method: 'post'
    })
}
// 删除用户
export const deleteUser = (ids, params) => {
    return axios.request({
        url:`/admin/user/delByIds/${ids}`,
        params:params,
        method: 'delete'
    })
}

// 重置失败次数
export const resetFailCount = (id) => {
    return axios.request({
        url:`/admin/user/resetFaiCount/${id}`,
        method: 'post'
    })
}

// 重置用户密码
export const resetPassWord = (id) => {
    return axios.request({
        url:`/admin/user/resetPassWithDefault/${id}`,
        method: 'post'
    })
}
